package cn.hdu.liang.ch2;

public class Service {
    Object object1 = new Object();

    public void methodA() {
        synchronized(object1) {
            System.out.println("methodA begin");
            boolean isContinueRun = true;
            while(isContinueRun) {
            }
            System.out.println("methodA end");
        }
    }


    public synchronized void methodB() {
        System.out.println("methodB begin");
        System.out.println("methodB end");
    }
}
